package com.dz.tool.Dao.Master;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.dz.tool.Vo.MysqlField;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;


@Mapper
public interface MasterMysqlMapper {

    // 执行Mysql语句
    void creatMysql(@Param("sql") String sql);

    List<Map<String,Object>> selectMysqlData(@Param("sql") String sql);

    // 获取所有表名
    List<String> selectTableNameAll();

    // 根据表名获取表结构及其字段
    List<MysqlField> selectTableNameOnCNAndTP(@Param("tableName")String tableName, @Param("TABLE_SCHEMA")String TABLE_SCHEMA);

    // 根据表名获取建表语句
    Map<String,Object> selectTableSql(@Param("tableName")String tableName);

    // 根据表名获取数据
    List<Map<String,Object>> selectData(@Param("tableName")String tableName);

    // 计算指定sql的总数据量
    Integer selectSqlCount(@Param("sql")String sql);

    // 获取指定表的索引
    List<Map<String,Object>> selectIndex(@Param("tableName")String tableName);

    // 获取指定表的表注释
    List<Map<String,String>> selectTableComment(@Param("baseName")String baseName);

}
